
## Leadership Targeting and Militant Alliance Breakdown

## Christopher W. Blair, Michael C. Horowitz, and Philip B.K. Potter

## Journal of Politics 2020

setwd("/Users/christopherblair/Dropbox/Publications/Journal of Politics 2020/Data, Figures, and Models/")

rm(list=ls())

library(survival)
library(coxme)
library(frailtySurv)
library(frailtyEM)
library(frailtypack)
library(nmisc)
library(xfun)
library(Hmisc)
library(haven)
library(foreign)
library(stargazer)
library(coefplot)
library(xtable)
library(texreg)
library(list)
library(haven)

set.seed(8675309)

data <- read_dta("alliance_decapitation_final.dta")

trim <- subset(data, year>= 1971)
price <- subset(data, pricedyad== 1 & year>= 1971)

## set stricter convergence criteria
coxph.control(eps = sqrt(.Machine$double.eps), toler.chol = .Machine$double.eps,
              iter.max = 1000, toler.inf = sqrt(.Machine$double.eps), outer.max = 1000)

coxme.control(eps = sqrt(.Machine$double.eps), toler.chol = .Machine$double.eps,
              iter.max = 1000)

## Table 1: Conditional Fraility -- Alliance Terminations

res1 <- matrix(NA,25,10)

m1a <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1a)
res1[1:2,1] <- c(m1a$coef[1],sqrt(m1a$var[1,1]))
res1[21,1] <- m1a$nevent
res1[22,1] <- m1a$n
res1[23,1] <- m1a$history[[1]]$c.loglik

m1b <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1b)
res1[1:2,2] <- c(m1b$coef[1],sqrt(m1b$var[1,1]))
res1[21,2] <- m1b$nevent
res1[22,2] <- m1b$n
res1[23,2] <- m1b$history[[1]]$c.loglik

m1c <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1c)
res1[1:2,3] <- c(m1c$coef[1],sqrt(m1c$var[1,1]))
res1[21,3] <- m1c$nevent
res1[22,3] <- m1c$n
res1[23,3] <- m1c$history[[1]]$c.loglik

m1d <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_lag1 +
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1d)
res1[1:2,4] <- c(m1d$coef[1],sqrt(m1d$var[1,1]))
res1[3:4,4] <- c(m1d$coef[2],sqrt(m1d$var[2,2]))
res1[21,4] <- m1d$nevent
res1[22,4] <- m1d$n
res1[23,4] <- m1d$history[[1]]$c.loglik

m1e <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1e)
res1[1:2,5] <- c(m1e$coef[1],sqrt(m1e$var[1,1]))
res1[21,5] <- m1e$nevent
res1[22,5] <- m1e$n
res1[23,5] <- m1e$history[[1]]$c.loglik

m1f <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leadercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1f)
res1[1:2,6] <- c(m1f$coef[1],sqrt(m1f$var[1,1]))
res1[21,6] <- m1f$nevent
res1[22,6] <- m1f$n
res1[23,6] <- m1f$history[[1]]$c.loglik

m1g <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_lag1 +
               leadercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1g)
res1[1:2,7] <- c(m1g$coef[1],sqrt(m1g$var[1,1]))
res1[3:4,7] <- c(m1g$coef[2],sqrt(m1g$var[2,2]))
res1[21,7] <- m1g$nevent
res1[22,7] <- m1g$n
res1[23,7] <- m1g$history[[1]]$c.loglik

m1h <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderkilled_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1h)
res1[1:2,8] <- c(m1h$coef[1],sqrt(m1h$var[1,1]))
res1[21,8] <- m1h$nevent
res1[22,8] <- m1h$n
res1[23,8] <- m1h$history[[1]]$c.loglik

m1i <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               foundercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1i)
res1[1:2,9] <- c(m1i$coef[1],sqrt(m1i$var[1,1]))
res1[21,9] <- m1i$nevent
res1[22,9] <- m1i$n
res1[23,9] <- m1i$history[[1]]$c.loglik

m1j <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderkilled_grp1_lag1 +
               foundercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m1j)
res1[1:2,10] <- c(m1j$coef[1],sqrt(m1j$var[1,1]))
res1[3:4,10] <- c(m1j$coef[2],sqrt(m1j$var[2,2]))
res1[21,10] <- m1j$nevent
res1[22,10] <- m1j$n
res1[23,10] <- m1j$history[[1]]$c.loglik

texreg(list(m1a, m1b, m1c, m1d, m1e, m1f, m1g, m1h, m1i, m1j), omit.coef="gamma", digits = 3, stars = c(0.001, 0.01, 0.05))

res1 <- round(res1,3)

## TABLE S.17: ROBUSTNESS MULTIPLOT -- DECAPITATION

multi1 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  cwinc1_lag1 +
                  cwinc2_lag1 +
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi1)

multi2 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  majpower1_lag1 +
                  majpower2_lag1+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi2)

multi3 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  ustroops1pc_lag1 +
                  ustroops2pc_lag1+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi3)

multi4 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  grp1_rev_fariss_lag1 +
                  grp2_rev_fariss_lag1 +
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi4)

multi5 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  allies_lag1 +
                  associates_lag1 +
                  supporters_lag1 +
                  fans_lag1 +
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi5)

price$decapitation_grp1_lag1 <- NULL
price$decapitation_grp1_lag1 <- price$decapitationprice_lag1

multi6 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = price,
                method = c("efron"),
                model = TRUE)

summary(multi6)

price$decapitation_grp1_lag1 <- NULL

mplot1 <- multiplot(multi4, multi2, multi3, multi5, multi1, multi6, secret.weapon=T, innerCI = 2, coefficients = c("decapitation_grp1_lag1"), sort = c("magnitude"), names=c("Repression", "Major Power", "U.S. Troops/Capita" , "Alliance Type \n (Allies, Associates, Supporters, Fans)", "Civil War", "Price (2012, 2018) Dyads Only"), horizontal = F, color = c("black", "black" , "black" , "black" , "black"), zeroColor ="red", textAngle = 0, title= "", xlab = "Standardized Coefficient", ylab="")
mplot1

## TABLE S.18-19: ROBUSTNESS MULTIPLOT -- FOUNDER DECAPITATION

trim$founder <- NULL
trim$founder <- trim$founderdecapitation_grp1_lag1

trim$nonfounder <- NULL
trim$nonfounder <- trim$nonfounderdecapitation_lag1

multi7 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  founder +
                  nonfounder +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  cwinc1_lag1 +
                  cwinc2_lag1 +
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi7)

multi8 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  founder +
                  nonfounder +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  majpower1_lag1 +
                  majpower2_lag1+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi8)

multi9 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  founder +
                  nonfounder +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  ustroops1pc_lag1 +
                  ustroops2pc_lag1+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = trim,
                method = c("efron"),
                model = TRUE)

summary(multi9)

multi10 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   founder +
                   nonfounder +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   grp1_rev_fariss_lag1 +
                   grp2_rev_fariss_lag1 +
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = trim,
                 method = c("efron"),
                 model = TRUE)

summary(multi10)

multi11 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   founder +
                   nonfounder +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   allies_lag1 +
                   associates_lag1 +
                   supporters_lag1 +
                   fans_lag1 +
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = trim,
                 method = c("efron"),
                 model = TRUE)

summary(multi11)

price$founder <- NULL
price$founder <- price$founderdecapitationprice_lag1
price$nonfounder <- NULL
price$nonfounder <- price$nonfounderdecapitationprice_lag1

multi12 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   founder +
                   nonfounder +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = price,
                 method = c("efron"),
                 model = TRUE)

summary(multi12)

price$founder <- NULL
price$nonfounder <- NULL

founderplot <- multiplot(multi10, multi8, multi9, multi11, multi7, multi12, secret.weapon=T, innerCI = 2, coefficients = c("founder"), sort = c("magnitude"), names=c("Repression", "Major Power", "U.S. Troops/Capita" , "Alliance Type \n (Allies, Associates, Supporters, Fans)", "Civil War", "Price (2012, 2018) Dyads Only"), horizontal = F, color = c("black", "black" , "black" , "black" , "black"), zeroColor ="red", textAngle = 0, title= "", xlab = "Standardized Coefficient", ylab="")
founderplot

nonfounderplot <- multiplot(multi10, multi8, multi9, multi11, multi7, multi12, secret.weapon=T, innerCI = 2, coefficients = c("nonfounder"), sort = c("magnitude"), names=c("Repression", "Major Power", "U.S. Troops/Capita" , "Alliance Type \n (Allies, Associates, Supporters, Fans)", "Civil War", "Price (2012, 2018) Dyads Only"), horizontal = F, color = c("black", "black" , "black" , "black" , "black"), zeroColor ="red", textAngle = 0, title= "", xlab = "Standardized Coefficient", ylab="")
nonfounderplot


## Table 2: Conditional Fraility -- Interorganizational Splits

res2 <- matrix(NA,25,4)

m2a <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numbreakdown) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m2a)
res2[1:2,1] <- c(m2a$coef[1],sqrt(m2a$var[1,1]))
res2[21,1] <- m2a$nevent
res2[22,1] <- m2a$n
res2[23,1] <- m2a$history[[1]]$c.loglik

m2b <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               founderdecapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numbreakdown) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m2b)
res2[1:2,2] <- c(m2b$coef[1],sqrt(m2b$var[1,1]))
res2[21,2] <- m2b$nevent
res2[22,2] <- m2b$n
res2[23,2] <- m2b$history[[1]]$c.loglik

m2c <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numbreakdown) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m2c)
res2[1:2,3] <- c(m2c$coef[1],sqrt(m2c$var[1,1]))
res2[21,3] <- m2c$nevent
res2[22,3] <- m2c$n
res2[23,3] <- m2c$history[[1]]$c.loglik

m2d <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               founderdecapitation_grp1_lag1 +
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numbreakdown) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m2d)
res2[1:2,4] <- c(m2d$coef[1],sqrt(m2d$var[1,1]))
res2[3:4,4] <- c(m2d$coef[2],sqrt(m2d$var[2,2]))
res2[21,4] <- m2d$nevent
res2[22,4] <- m2d$n
res2[23,4] <- m2d$history[[1]]$c.loglik

latex(m2a)

## Table 3: Shared Fraility -- Targeted Group Collapse

res3 <- matrix(NA,25,4)

m3a <- coxph(formula = Surv(collapse1_start, collapse1_end, collapse1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(twostrata) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m3a)
res3[1:2,1] <- c(m3a$coef[1],sqrt(m3a$var[1,1]))
res3[21,1] <- m3a$nevent
res3[22,1] <- m3a$n
res3[23,1] <- m3a$history[[1]]$c.loglik
res3[24,1] <-AIC(m3a)

m3b <- coxph(formula = Surv(collapse1_start, collapse1_end, collapse1) ~
               founderdecapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(twostrata) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m3b)
res3[1:2,2] <- c(m3b$coef[1],sqrt(m3b$var[1,1]))
res3[21,2] <- m3b$nevent
res3[22,2] <- m3b$n
res3[23,2] <- m3b$history[[1]]$c.loglik
res3[24,2] <-AIC(m3b)

texreg(list(m3a, m3b, m2a, m2b, m2c, m2d), omit.coef="gamma", digits = 3, stars = c(0.001, 0.01, 0.05))


## Table 4: Weighted Fraility -- Alliance Terminations

res4 <- matrix(NA,25,10)

m4a <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             weights = weights,
             model = TRUE)

summary(m4a)
res4[1:2,1] <- c(m4a$coef[1],sqrt(m4a$var[1,1]))
res4[21,1] <- m4a$nevent
res4[22,1] <- m4a$n
res4[23,1] <- m4a$history[[1]]$c.loglik

m4b <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             weights = weights,
             model = TRUE)

summary(m4b)
res4[1:2,2] <- c(m4b$coef[1],sqrt(m4b$var[1,1]))
res4[21,2] <- m4b$nevent
res4[22,2] <- m4b$n
res4[23,2] <- m4b$history[[1]]$c.loglik

m4c <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights = weights,
             method = c("efron"),
             model = TRUE)

summary(m4c)
res4[1:2,3] <- c(m4c$coef[1],sqrt(m4c$var[1,1]))
res4[21,3] <- m4c$nevent
res4[22,3] <- m4c$n
res4[23,3] <- m4c$history[[1]]$c.loglik

m4d <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_lag1 +
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights = weights,
             method = c("efron"),
             model = TRUE)

summary(m4d)
res4[1:2,4] <- c(m4d$coef[1],sqrt(m4d$var[1,1]))
res4[3:4,4] <- c(m4d$coef[2],sqrt(m4d$var[2,2]))
res4[21,4] <- m4d$nevent
res4[22,4] <- m4d$n
res4[23,4] <- m4d$history[[1]]$c.loglik

m4e <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m4e)
res4[1:2,5] <- c(m4e$coef[1],sqrt(m4e$var[1,1]))
res4[21,5] <- m4e$nevent
res4[22,5] <- m4e$n
res4[23,5] <- m4e$history[[1]]$c.loglik

m4f <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leadercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m4f)
res4[1:2,6] <- c(m4f$coef[1],sqrt(m4f$var[1,1]))
res4[21,6] <- m4f$nevent
res4[22,6] <- m4f$n
res4[23,6] <- m4f$history[[1]]$c.loglik

m4g <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_lag1 +
               leadercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m4g)
res4[1:2,7] <- c(m4g$coef[1],sqrt(m4g$var[1,1]))
res4[3:4,7] <- c(m4g$coef[2],sqrt(m4g$var[2,2]))
res4[21,7] <- m4g$nevent
res4[22,7] <- m4g$n
res4[23,7] <- m4g$history[[1]]$c.loglik

m4h <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderkilled_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m4h)
res4[1:2,8] <- c(m4h$coef[1],sqrt(m4h$var[1,1]))
res4[21,8] <- m4h$nevent
res4[22,8] <- m4h$n
res4[23,8] <- m4h$history[[1]]$c.loglik

m4i <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               foundercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m4i)
res4[1:2,9] <- c(m4i$coef[1],sqrt(m4i$var[1,1]))
res4[21,9] <- m4i$nevent
res4[22,9] <- m4i$n
res4[23,9] <- m4i$history[[1]]$c.loglik

m4j <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderkilled_grp1_lag1 +
               foundercaptured_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m4j)
res4[1:2,10] <- c(m4j$coef[1],sqrt(m4j$var[1,1]))
res4[3:4,10] <- c(m4j$coef[2],sqrt(m4j$var[2,2]))
res4[21,10] <- m4j$nevent
res4[22,10] <- m4j$n
res4[23,10] <- m4j$history[[1]]$c.loglik

texreg(list(m4a, m4b, m4c, m4d, m4e, m4f, m4g, m4h, m4i, m4j), omit.coef="gamma", digits = 3, stars = c(0.001, 0.01, 0.05))

res4 <- round(res1,3)


## Table S.11: IPTW Interorganizational Splits

res5 <- matrix(NA,25,4)

m5a <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m5a)
res5[1:2,1] <- c(m5a$coef[1],sqrt(m5a$var[1,1]))
res5[21,1] <- m5a$nevent
res5[22,1] <- m5a$n
res5[23,1] <- m5a$history[[1]]$c.loglik

m5b <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               founderdecapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m5b)
res5[1:2,2] <- c(m5b$coef[1],sqrt(m5b$var[1,1]))
res5[21,2] <- m5b$nevent
res5[22,2] <- m5b$n
res5[23,2] <- m5b$history[[1]]$c.loglik

m5c <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m5c)
res5[1:2,3] <- c(m5c$coef[1],sqrt(m5c$var[1,1]))
res5[21,3] <- m5c$nevent
res5[22,3] <- m5c$n
res5[23,3] <- m5c$history[[1]]$c.loglik

m5d <- coxph(formula = Surv(breakdown_start, breakdown_end, breakdown) ~
               founderdecapitation_grp1_lag1 +
               nonfounderdecapitation_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m5d)
res5[1:2,4] <- c(m5d$coef[1],sqrt(m5d$var[1,1]))
res5[3:4,4] <- c(m5d$coef[2],sqrt(m5d$var[2,2]))
res5[21,4] <- m5d$nevent
res5[22,4] <- m5d$n
res5[23,4] <- m5d$history[[1]]$c.loglik

res5 <- round(res5,3)

## Table S.11: IPTW Targeted Group Collapse

res6 <- matrix(NA,25,4)

m6a <- coxph(formula = Surv(collapse1_start, collapse1_end, collapse1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(twostrata) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             weights=weights,
             method = c("efron"),
             model = TRUE)

summary(m6a)
res6[1:2,1] <- c(m6a$coef[1],sqrt(m6a$var[1,1]))
res6[21,1] <- m6a$nevent
res6[22,1] <- m6a$n
res6[23,1] <- m6a$history[[1]]$c.loglik
res6[24,1] <- AIC(m6a)

m6b <- emfrail(Surv(collapse1_start, collapse1_end, collapse1) ~
                 founderdecapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(twostrata),
               data=trim,
               weights=weights,
               method = c("efron"),
               model = TRUE)

summary(m6b)
res6[1:2,2] <- c(m6b$coef[1],sqrt(m6b$var[1,1]))
res6[22,2] <- c(1989)
res6[23,2] <- c(-98.324)
res6[24,2] <- AIC(m6b)

res6 <- round(res6,3)

texreg(list(m6a, m5a, m5b, m5c, m5d), omit.coef="gamma", digits = 3, stars = c(0.001, 0.01, 0.05))


## Table S.20: Conditional Fraility -- Alliance Terminations with 3 Year Decapitation

res7 <- matrix(NA,25,10)

m7a <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7a)
res7[1:2,1] <- c(m7a$coef[1],sqrt(m7a$var[1,1]))
res7[21,1] <- m7a$nevent
res7[22,1] <- m7a$n
res7[23,1] <- m7a$history[[1]]$c.loglik

m7b <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7b)
res7[1:2,2] <- c(m7b$coef[1],sqrt(m7b$var[1,1]))
res7[21,2] <- m7b$nevent
res7[22,2] <- m7b$n
res7[23,2] <- m7b$history[[1]]$c.loglik

m7c <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               nonfounderdecapitation_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7c)
res7[1:2,3] <- c(m7c$coef[1],sqrt(m7c$var[1,1]))
res7[21,3] <- m7c$nevent
res7[22,3] <- m7c$n
res7[23,3] <- m7c$history[[1]]$c.loglik

m7d <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_any3 +
               nonfounderdecapitation_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7d)
res7[1:2,4] <- c(m7d$coef[1],sqrt(m7d$var[1,1]))
res7[3:4,4] <- c(m7d$coef[2],sqrt(m7d$var[2,2]))
res7[21,4] <- m7d$nevent
res7[22,4] <- m7d$n
res7[23,4] <- m7d$history[[1]]$c.loglik

m7e <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7e)
res7[1:2,5] <- c(m7e$coef[1],sqrt(m7e$var[1,1]))
res7[21,5] <- m7e$nevent
res7[22,5] <- m7e$n
res7[23,5] <- m7e$history[[1]]$c.loglik

m7f <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leadercaptured_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7f)
res7[1:2,6] <- c(m7f$coef[1],sqrt(m7f$var[1,1]))
res7[21,6] <- m7f$nevent
res7[22,6] <- m7f$n
res7[23,6] <- m7f$history[[1]]$c.loglik

m7g <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_any3 +
               leadercaptured_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7g)
res7[1:2,7] <- c(m7g$coef[1],sqrt(m7g$var[1,1]))
res7[3:4,7] <- c(m7g$coef[2],sqrt(m7g$var[2,2]))
res7[21,7] <- m7g$nevent
res7[22,7] <- m7g$n
res7[23,7] <- m7g$history[[1]]$c.loglik

m7h <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderkilled_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7h)
res7[1:2,8] <- c(m7h$coef[1],sqrt(m7h$var[1,1]))
res7[21,8] <- m7h$nevent
res7[22,8] <- m7h$n
res7[23,8] <- m7h$history[[1]]$c.loglik

m7i <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               foundercaptured_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7i)
res7[1:2,9] <- c(m7i$coef[1],sqrt(m7i$var[1,1]))
res7[21,9] <- m7i$nevent
res7[22,9] <- m7i$n
res7[23,9] <- m7i$history[[1]]$c.loglik

m7j <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderkilled_grp1_any3 +
               foundercaptured_grp1_any3 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m7j)
res7[1:2,10] <- c(m7j$coef[1],sqrt(m7j$var[1,1]))
res7[3:4,10] <- c(m7j$coef[2],sqrt(m7j$var[2,2]))
res7[21,10] <- m7j$nevent
res7[22,10] <- m7j$n
res7[23,10] <- m7j$history[[1]]$c.loglik

texreg(list(m7a, m7b, m7c, m7d, m7e, m7f, m7g, m7h, m7i, m7j), omit.coef="gamma", digits = 3, stars = c(0.001, 0.01, 0.05))

res7 <- round(res7,3)

## Figure S.12: Conditional Fraility -- Alliance Terminations with Other Exits

res8 <- matrix(NA,25,2)

m8a <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1+
               otherexit_grp1_lag1+
               sharedideo2 +
               sharedsponsor_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m8a)
res8[21,1] <- m8a$nevent
res8[22,1] <- m8a$n
res8[23,1] <- m8a$history[[1]]$c.loglik

m8b <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_lag1 +
               nonfounderdecapitation_lag1+
               otherexit_grp1_lag1+
               sharedideo2 +
               sharedsponsor_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m8b)
res8[21,2] <- m8b$nevent
res8[22,2] <- m8b$n
res8[23,2] <- m8b$history[[1]]$c.loglik


coef.vec <- c(0.323, 0.363, 0.328, 0.283, 0.363)
se.vec <- c(0.120, 0.151, 0.126, 0.143, 0.151)
var.names <- c("Any Leader Decapitated", "Non-Decapitation Leader Exit", "Founder Decapitated", "Non-Founder Decapitated", "Non-Decapitation Leader Exit")

y.axis <- length(var.names):1

layout(matrix(c(2,1),1,2), widths = c(1.5, 5))

par(mar=c(6,5,.5,1))

plot(coef.vec, y.axis, type = "p", axes = F, xlab = "Standardized Coefficient", ylab = "", pch = c(19,15,17,18, 15), col = c("gray0", "gray0" , "gray61" , "gray61" , "gray61"), cex = 2, 
     xlim = c(-.1,.9), xaxs = "r", main = "")

segments(coef.vec-qnorm(.975)*se.vec, y.axis, coef.vec+qnorm(.975)*se.vec, y.axis, lwd =  2, col = c("gray0", "gray0", "gray61", "gray61", "gray61"))

segments(coef.vec-qnorm(.95)*se.vec, y.axis, coef.vec+qnorm(.95)*se.vec, y.axis, lwd =  5, col = c("gray0", "gray0", "gray61", "gray61", "gray61"))

axis(1, at = seq(-.1,.9,by=.1), labels =  seq(-.1,.9,by=.1), tick = T,
     cex.axis = .8, mgp = c(2,.5,0))
axis(2, at = c(5, 4, 3, 2, 1, 0), label = c("Any Leader Decapitated", "Non-Decapitation Leader Exit", "Founder Decapitated", "Non-Founder Decapitated", "Non-Decapitation Leader Exit", ""), las = 1, tick = T, 
     cex.axis = .8) 

par(mar=c(2,0,.5,0)) 

plot(seq(0,1,length=length(var.names)), y.axis, type = "n", axes = F,  xlab = "Standardized Coefficient", ylab = "")

left.side <- .3
segments(left.side,5.1,left.side,1.4) 
segments(left.side,5.1,left.side+.15,5.1)
segments(left.side,1.4,left.side+.15,1.4)
text(.2, 3.35, "Type of Leadership Removal", srt = 90, font = 3, cex = 1)


m8c <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               leaderkilled_grp1_lag1+
               leadercaptured_grp1_lag1+
               natcauses_grp1_lag1+
               thrownout_grp1_lag1+
               sharedideo2 +
               sharedsponsor_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m8c)
res8[21,3] <- m8c$nevent
res8[22,3] <- m8c$n
res8[23,3] <- m8c$history[[1]]$c.loglik


coef.vec <- c(0.314, 0.344, 0.342, 0.442)
se.vec <- c(0.153, 0.144, 0.207, 0.206)
var.names <- c("Leader Killed", "Leader Captured", "Death by Natural Causes", "Leader Thrownout")

y.axis <- length(var.names):1

layout(matrix(c(2,1),1,2), widths = c(1.5, 5))

par(mar=c(6,5,.5,1))

plot(coef.vec, y.axis, type = "p", axes = F, xlab = "Standardized Coefficient", ylab = "", pch = c(19,15,17,18), col = c("gray0", "gray0" , "gray0" , "gray0"), cex = 2, 
     xlim = c(-.1,.9), xaxs = "r", main = "")

segments(coef.vec-qnorm(.975)*se.vec, y.axis, coef.vec+qnorm(.975)*se.vec, y.axis, lwd =  2, col = c("gray0", "gray0", "gray0", "gray0"))

segments(coef.vec-qnorm(.95)*se.vec, y.axis, coef.vec+qnorm(.95)*se.vec, y.axis, lwd =  5, col = c("gray0", "gray0", "gray0", "gray0"))

axis(1, at = seq(-.1,.9,by=.1), labels =  seq(-.1,.9,by=.1), tick = T,
     cex.axis = .8, mgp = c(2,.5,0))
axis(2, at = c(5, 4, 3, 2, 1, 0), label = c("", "Leader Killed", "Leader Captured", "Death by Natural Causes", "Leader Thrownout", ""), las = 1, tick = T, 
     cex.axis = .8) 

par(mar=c(2,0,.5,0)) 

plot(seq(0,1,length=length(var.names)), y.axis, type = "n", axes = F,  xlab = "Standardized Coefficient", ylab = "")

left.side <- .5
segments(left.side,4.1,left.side,1.3) 
segments(left.side,4.1,left.side+.15,4.1)
segments(left.side,1.3,left.side+.15,1.3)
text(.35, 2.75, "Type of Leadership Removal", srt = 90, font = 3, cex = 1)

texreg(list(m8a, m8b, m8c), omit.coef="gamma", digits = 3, stars = c(0.001, 0.01, 0.05))

res8 <- round(res8,3)


## Figure S.13: Conditional Fraility -- Alliance Terminations with Co-Leaders

res9 <- matrix(NA,25,2)

m9a <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1+
               coleader_grp1_lag1+
               decapitation_grp1_lag1*coleader_grp1_lag1+
               sharedideo2 +
               sharedsponsor_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m9a)
res9[1:2,1] <- c(m9a$coef[1],sqrt(m9a$var[1,1]))
res9[3:4,1] <- c(m9a$coef[2],sqrt(m9a$var[2,2]))
res9[21,1] <- m9a$nevent
res9[22,1] <- m9a$n
res9[23,1] <- m9a$history[[1]]$c.loglik

m9b <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               founderdecapitation_grp1_lag1+
               coleader_grp1_lag1+
               founderdecapitation_grp1_lag1*coleader_grp1_lag1+
               sharedideo2 +
               sharedsponsor_lag1 +
               agediff +
               age1 +
               age2 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = trim,
             method = c("efron"),
             model = TRUE)

summary(m9b)
res9[1:2,2] <- c(m9b$coef[1],sqrt(m9b$var[1,1]))
res9[3:4,2] <- c(m9b$coef[2],sqrt(m9b$var[2,2]))
res9[21,2] <- m9b$nevent
res9[22,2] <- m9b$n
res9[23,2] <- m9b$history[[1]]$c.loglik

texreg(list(m9a, m9b), omit.coef="gamma", digits = 3, stars = c(0.01, 0.05, 0.1))

coef.vec <- c(0.370, 0.064, -0.170, 0.367, 0.070, -0.209)
se.vec <- c(0.134, 0.108, 0.179, 0.134, 0.107, 0.243)
var.names <- c("Any Leader Decapitated, \n No Co-Leader", "No Decapitation, \n Co-Leader", "Any Leader Decapitated, \n Co-Leader", "Founder Decapitated, \n No Co-Leader", "No Decapitation, \n Co-Leader", "Founder Decapitated, \n Co-Leader")

y.axis <- length(var.names):1

layout(matrix(c(2,1),1,2), widths = c(1.5, 5))

par(mar=c(6,5,.5,1))

plot(coef.vec, y.axis, type = "p", axes = F, xlab = "Standardized Coefficient", ylab = "", pch = c(19,15,17,18, 15, 4), col = c("gray0", "gray0" , "gray0" , "gray61" , "gray61" , "gray61"), cex = 2, 
     xlim = c(-.8,.8), xaxs = "r", main = "")

segments(coef.vec-qnorm(.975)*se.vec, y.axis, coef.vec+qnorm(.975)*se.vec, y.axis, lwd =  2, col = c("gray0", "gray0" , "gray0" , "gray61" , "gray61" , "gray61"))

segments(coef.vec-qnorm(.95)*se.vec, y.axis, coef.vec+qnorm(.95)*se.vec, y.axis, lwd =  5, col = c("gray0", "gray0" , "gray0" , "gray61" , "gray61" , "gray61"))

axis(1, at = seq(-.8,.8,by=.2), labels =  seq(-.8,.8,by=.2), tick = T,
     cex.axis = .8, mgp = c(2,.5,0))
axis(2, at = c(6, 5, 4, 3, 2, 1, 0), label = c("Any Leader Decapitated, \n No Co-Leader", "No Decapitation, \n Co-Leader", "Any Leader Decapitated, \n Co-Leader", "Founder Decapitated, \n No Co-Leader", "No Decapitation, \n Co-Leader", "Founder Decapitated, \n Co-Leader", ""), las = 1, tick = T, 
     cex.axis = .8) 

par(mar=c(2,0,.5,0)) 

plot(seq(0,1,length=length(var.names)), y.axis, type = "n", axes = F,  xlab = "Standardized Coefficient", ylab = "")

left.side <- .3
segments(left.side,6.2,left.side,1.5) 
segments(left.side,6.2,left.side+.15,6.2)
segments(left.side,1.5,left.side+.15,1.5)
text(.2, 4, "Co-Leadership and Leader Removal", srt = 90, font = 3, cex = 1)

## Figure S.14: Conditional Fraility -- Other Exits with Co-Leaders

res10 <- matrix(NA,25,2)

m10a <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1+
                otherexit_grp1_lag1+
                coleader_grp1_lag1+
                decapitation_grp1_lag1*coleader_grp1_lag1+
                otherexit_grp1_lag1*coleader_grp1_lag1+
                sharedideo2 +
                sharedsponsor_lag1 +
                agediff +
                age1 +
                age2 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = trim,
              method = c("efron"),
              model = TRUE)

summary(m10a)
res10[1:2,1] <- c(m10a$coef[1],sqrt(m10a$var[1,1]))
res10[3:4,1] <- c(m10a$coef[2],sqrt(m10a$var[2,2]))
res10[21,1] <- m10a$nevent
res10[22,1] <- m10a$n
res10[23,1] <- m10a$history[[1]]$c.loglik

coef.vec <- c(0.373, 0.371, 0.063, -0.178, -0.051)
se.vec <- c(0.135, 0.202, 0.108, 0.185, 0.373)
var.names <- c("Any Leader Decapitated, \n No Co-Leader", "Any Other Exit, \n No Co-Leader", "No Decapitation, \n Co-Leader", "Any Leader Decapitated, \n Co-Leader", "Any Other Exit, \n Co-Leader")

y.axis <- length(var.names):1

layout(matrix(c(2,1),1,2), widths = c(1.5, 5))

par(mar=c(6,5,.5,1))

plot(coef.vec, y.axis, type = "p", axes = F, xlab = "Standardized Coefficient", ylab = "", pch = c(19,15,17,18, 15, 4), col = c("gray0", "gray0" , "gray0" , "gray0" , "gray0" , "gray0"), cex = 2, 
     xlim = c(-.8,.8), xaxs = "r", main = "")

segments(coef.vec-qnorm(.975)*se.vec, y.axis, coef.vec+qnorm(.975)*se.vec, y.axis, lwd =  2, col = c("gray0", "gray0" , "gray0" , "gray0" , "gray0" , "gray0"))

segments(coef.vec-qnorm(.95)*se.vec, y.axis, coef.vec+qnorm(.95)*se.vec, y.axis, lwd =  5, col = c("gray0", "gray0" , "gray0" , "gray0" , "gray0" , "gray0"))

axis(1, at = seq(-.8,.8,by=.2), labels =  seq(-.8,.8,by=.2), tick = T,
     cex.axis = .8, mgp = c(2,.5,0))
axis(2, at = c(5, 4, 3, 2, 1, 0), label = c("Any Leader Decapitated, \n No Co-Leader", "Any Other Exit, \n No Co-Leader", "No Decapitation, \n Co-Leader", "Any Leader Decapitated, \n Co-Leader", "Any Other Exit, \n Co-Leader", ""), las = 1, tick = T, 
     cex.axis = .8) 

par(mar=c(2,0,.5,0)) 

plot(seq(0,1,length=length(var.names)), y.axis, type = "n", axes = F,  xlab = "Standardized Coefficient", ylab = "")

left.side <- .3
segments(left.side,5.1,left.side,1.4) 
segments(left.side,5.1,left.side+.15,5.1)
segments(left.side,1.4,left.side+.15,1.4)
text(.2, 3.25, "Co-Leadership and Other Leader Exits", srt = 90, font = 3, cex = 1)


## Figure S.21: Iteratively Dropping Groups

check <- subset(data, year>= 1971 & group1!="ABU SAYYAF GROUP (ASG)")

asg <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(asg)

check <- subset(data, year>= 1971 & group1!="ACTION DIRECTE")

ad <- coxph(formula = Surv(term1_start, term1_end, term1) ~
              decapitation_grp1_lag1 +
              agediff +
              age1 +
              age2 +
              sharedideo2 +
              sharedsponsor_lag1 +
              capratioplus_dir +
              grp1_newalliance_lag1 +
              grp2_newalliance_lag1+
              ln_dist +
              ln_pop1_lag1 +
              ln_pop2_lag1 +
              ln_gdppc1_lag1 +
              ln_gdppc2_lag1 +
              polity1_lag1 +
              polity2_lag1 +
              coldwar+
              post911+
              
              cluster(dyad_id)+
              strata(numterm1) +
              frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
            data = check,
            method = c("efron"),
            model = TRUE)

summary(ad)

check <- subset(data, year>= 1971 & group1!="AL-AQSA MARTYRS BRIGADE")

aamb <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(aamb)

check <- subset(data, year>= 1971 & group1!="AL-QA'IDA IN IRAQ (TAWHID AND JIHAD)")

aqi <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(aqi)

check <- subset(data, year>= 1971 & group1!="AL-QA`IDA IN THE ARABIAN PENINSULA (AQAP)")

aqap <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(aqap)

check <- subset(data, year>= 1971 & group1!="AL-QA`IDA IN THE LANDS OF THE ISLAMIC MAGHREB (AQLIM)")

aqim <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(aqim)

check <- subset(data, year>= 1971 & group1!="ANSAR AL-ISLAM")

aai <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(aai)

check <- subset(data, year>= 1971 & group1!="ARMED FORCES OF NATIONAL RESISTANCE (FARN)")

farn <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(farn)

check <- subset(data, year>= 1971 & group1!="ARMED ISLAMIC GROUP (GIA)")

gia <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(gia)

check <- subset(data, year>= 1971 & group1!="ARMED PROLETARIAN NUCLEI (NAP)")

nap <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(nap)

check <- subset(data, year>= 1971 & group1!="ARMENIAN SECRET ARMY FOR THE LIBERATION OF ARMENIA")

asala <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(asala)

check <- subset(data, year>= 1971 & group1!="BAADER-MEINHOF GROUP")

raf <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(raf)

check <- subset(data, year>= 1971 & group1!="BASQUE FATHERLAND AND FREEDOM (ETA)")

eta <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(eta)

check <- subset(data, year>= 1971 & group1!="CINCHONEROS")

cinchoneros <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                       decapitation_grp1_lag1 +
                       agediff +
                       age1 +
                       age2 +
                       sharedideo2 +
                       sharedsponsor_lag1 +
                       capratioplus_dir +
                       grp1_newalliance_lag1 +
                       grp2_newalliance_lag1+
                       ln_dist +
                       ln_pop1_lag1 +
                       ln_pop2_lag1 +
                       ln_gdppc1_lag1 +
                       ln_gdppc2_lag1 +
                       polity1_lag1 +
                       polity2_lag1 +
                       coldwar+
                       post911+
                       
                       cluster(dyad_id)+
                       strata(numterm1) +
                       frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                     data = check,
                     method = c("efron"),
                     model = TRUE)

summary(cinchoneros)

check <- subset(data, year>= 1971 & group1!="DAGESTANI SHAR'IAH JAMAAT")

dst <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(dst)

check <- subset(data, year>= 1971 & group1!="DEV SOL")

devsol <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = check,
                method = c("efron"),
                model = TRUE)

summary(devsol)

check <- subset(data, year>= 1971 & group1!="DEVRIMCI HALK KURTULUS CEPHESI (DHKP/C)")

dhkpc <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(dhkpc)

check <- subset(data, year>= 1971 & group1!="GREAT EASTERN ISLAMIC RAIDERS FRONT (IBDA-C)")

ibdac <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(ibdac)

check <- subset(data, year>= 1971 & group1!="HAMAS (ISLAMIC RESISTANCE MOVEMENT)")

hamas <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(hamas)

check <- subset(data, year>= 1971 & group1!="HARAKAT UL-MUJAHIDIN (HUM)")

hum <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(hum)

check <- subset(data, year>= 1971 & group1!="HARKATUL JIHAD-E-ISLAMI")

huji <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(huji)

check <- subset(data, year>= 1971 & group1!="HIZBALLAH")

hizballah <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                     decapitation_grp1_lag1 +
                     agediff +
                     age1 +
                     age2 +
                     sharedideo2 +
                     sharedsponsor_lag1 +
                     capratioplus_dir +
                     grp1_newalliance_lag1 +
                     grp2_newalliance_lag1+
                     ln_dist +
                     ln_pop1_lag1 +
                     ln_pop2_lag1 +
                     ln_gdppc1_lag1 +
                     ln_gdppc2_lag1 +
                     polity1_lag1 +
                     polity2_lag1 +
                     coldwar+
                     post911+
                     
                     cluster(dyad_id)+
                     strata(numterm1) +
                     frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                   data = check,
                   method = c("efron"),
                   model = TRUE)

summary(hizballah)

check <- subset(data, year>= 1971 & group1!="INDEPENDENT ARMED REVOLUTIONARY MOVEMENT (MIRA)")

mira <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(mira)

check <- subset(data, year>= 1971 & group1!="IRISH REPUBLICAN ARMY (IRA)")

ira <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(ira)

check <- subset(data, year>= 1971 & group1!="ISLAMIC MOVEMENT OF UZBEKISTAN (IMU)")

imu <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(imu)

check <- subset(data, year>= 1971 & group1!="JAGRATA MUSLIM JANATA BANGLADESH")

jmjb <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(jmjb)

check <- subset(data, year>= 1971 & group1!="JAISH-E-MOHAMMAD (JEM)")

jem <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(jem)

check <- subset(data, year>= 1971 & group1!="JAMA'ATUL MUJAHIDEEN BANGLADESH (JMB)")

jmb <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(jmb)

check <- subset(data, year>= 1971 & group1!="JAMIAT UL-MUJAHEDIN (JUM)")

jum <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(jum)

check <- subset(data, year>= 1971 & group1!="JEMAAH ISLAMIYA (JI)")

ji <- coxph(formula = Surv(term1_start, term1_end, term1) ~
              decapitation_grp1_lag1 +
              agediff +
              age1 +
              age2 +
              sharedideo2 +
              sharedsponsor_lag1 +
              capratioplus_dir +
              grp1_newalliance_lag1 +
              grp2_newalliance_lag1+
              ln_dist +
              ln_pop1_lag1 +
              ln_pop2_lag1 +
              ln_gdppc1_lag1 +
              ln_gdppc2_lag1 +
              polity1_lag1 +
              polity2_lag1 +
              coldwar+
              post911+
              
              cluster(dyad_id)+
              strata(numterm1) +
              frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
            data = check,
            method = c("efron"),
            model = TRUE)

summary(ji)

check <- subset(data, year>= 1971 & group1!="KUMPULAN MUJAHIDIN MALAYSIA (KMM)")

kmm <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(kmm)

check <- subset(data, year>= 1971 & group1!="KURDISTAN WORKERS' PARTY (PKK)")

pkk <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(pkk)

check <- subset(data, year>= 1971 & group1!="LASHKAR-E-JHANGVI")

lej <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(lej)

check <- subset(data, year>= 1971 & group1!="LASHKAR-E-TAIBA (LET)")

let <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(let)

check <- subset(data, year>= 1971 & group1!="LEBANESE ARMED REVOLUTIONARY FACTION")

larf <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(larf)

check <- subset(data, year>= 1971 & group1!="LIBYAN ISLAMIC FIGHTING GROUP (LIFG)")

lifg <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(lifg)

check <- subset(data, year>= 1971 & group1!="LORENZO ZELAYA REVOLUTIONARY FRONT (LZRF)")

lzrf <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(lzrf)

check <- subset(data, year>= 1971 & group1!="M-19 (MOVEMENT OF APRIL 19)")

m19 <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(m19)

check <- subset(data, year>= 1971 & group1!="MARXIST-LENINIST ARMED PROPAGANDA UNIT")

mlapu <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(mlapu)

check <- subset(data, year>= 1971 & group1!="MONTONEROS")

montoneros <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(montoneros)

check <- subset(data, year>= 1971 & group1!="MOROCCAN ISLAMIC COMBATANT GROUP")

micg <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                      decapitation_grp1_lag1 +
                      agediff +
                      age1 +
                      age2 +
                      sharedideo2 +
                      sharedsponsor_lag1 +
                      capratioplus_dir +
                      grp1_newalliance_lag1 +
                      grp2_newalliance_lag1+
                      ln_dist +
                      ln_pop1_lag1 +
                      ln_pop2_lag1 +
                      ln_gdppc1_lag1 +
                      ln_gdppc2_lag1 +
                      polity1_lag1 +
                      polity2_lag1 +
                      coldwar+
                      post911+
                      
                      cluster(dyad_id)+
                      strata(numterm1) +
                      frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                    data = check,
                    method = c("efron"),
                    model = TRUE)

summary(micg)

check <- subset(data, year>= 1971 & group1!="ORANGE VOLUNTEERS (OV)")

ov <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(ov)

check <- subset(data, year>= 1971 & group1!="PALESTINIAN ISLAMIC JIHAD (PIJ)")

pij <- coxph(formula = Surv(term1_start, term1_end, term1) ~
              decapitation_grp1_lag1 +
              agediff +
              age1 +
              age2 +
              sharedideo2 +
              sharedsponsor_lag1 +
              capratioplus_dir +
              grp1_newalliance_lag1 +
              grp2_newalliance_lag1+
              ln_dist +
              ln_pop1_lag1 +
              ln_pop2_lag1 +
              ln_gdppc1_lag1 +
              ln_gdppc2_lag1 +
              polity1_lag1 +
              polity2_lag1 +
              coldwar+
              post911+
              
              cluster(dyad_id)+
              strata(numterm1) +
              frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
            data = check,
            method = c("efron"),
            model = TRUE)

summary(pij)

check <- subset(data, year>= 1971 & group1!="PKK/KONGRA-GEL")

pkkkg <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(pkkkg)

check <- subset(data, year>= 1971 & group1!="POPULAR FRONT FOR THE LIBERATION OF PALESTINE (PFLP)")

pflp <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(pflp)

check <- subset(data, year>= 1971 & group1!="POPULAR RESISTANCE COMMITTEES")

prc <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(prc)

check <- subset(data, year>= 1971 & group1!="POPULAR REVOLUTIONARY ARMY (MEXICO)")

pra <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(pra)

check <- subset(data, year>= 1971 & group1!="PRIMA LINEA")

prima <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(prima)

check <- subset(data, year>= 1971 & group1!="RED BRIGADES")

rb <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(rb)

check <- subset(data, year>= 1971 & group1!="RED HAND DEFENDERS (RHD)")

rhd <- coxph(formula = Surv(term1_start, term1_end, term1) ~
              decapitation_grp1_lag1 +
              agediff +
              age1 +
              age2 +
              sharedideo2 +
              sharedsponsor_lag1 +
              capratioplus_dir +
              grp1_newalliance_lag1 +
              grp2_newalliance_lag1+
              ln_dist +
              ln_pop1_lag1 +
              ln_pop2_lag1 +
              ln_gdppc1_lag1 +
              ln_gdppc2_lag1 +
              polity1_lag1 +
              polity2_lag1 +
              coldwar+
              post911+
              
              cluster(dyad_id)+
              strata(numterm1) +
              frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
            data = check,
            method = c("efron"),
            model = TRUE)

summary(rhd)


check <- subset(data, year>= 1971 & group1!="SALAFIA JIHADIA")

sj <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(sj)

check <- subset(data, year>= 1971 & group1!="SHINING PATH (SL)")

sl <- coxph(formula = Surv(term1_start, term1_end, term1) ~
              decapitation_grp1_lag1 +
              agediff +
              age1 +
              age2 +
              sharedideo2 +
              sharedsponsor_lag1 +
              capratioplus_dir +
              grp1_newalliance_lag1 +
              grp2_newalliance_lag1+
              ln_dist +
              ln_pop1_lag1 +
              ln_pop2_lag1 +
              ln_gdppc1_lag1 +
              ln_gdppc2_lag1 +
              polity1_lag1 +
              polity2_lag1 +
              coldwar+
              post911+
              
              cluster(dyad_id)+
              strata(numterm1) +
              frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
            data = check,
            method = c("efron"),
            model = TRUE)

summary(sl)

check <- subset(data, year>= 1971 & group1!="SPECIAL PURPOSE ISLAMIC REGIMENT (SPIR)")

spir <- coxph(formula = Surv(term1_start, term1_end, term1) ~
              decapitation_grp1_lag1 +
              agediff +
              age1 +
              age2 +
              sharedideo2 +
              sharedsponsor_lag1 +
              capratioplus_dir +
              grp1_newalliance_lag1 +
              grp2_newalliance_lag1+
              ln_dist +
              ln_pop1_lag1 +
              ln_pop2_lag1 +
              ln_gdppc1_lag1 +
              ln_gdppc2_lag1 +
              polity1_lag1 +
              polity2_lag1 +
              coldwar+
              post911+
              
              cluster(dyad_id)+
              strata(numterm1) +
              frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
            data = check,
            method = c("efron"),
            model = TRUE)

summary(spir)

check <- subset(data, year>= 1971 & group1!="STUDENTS ISLAMIC MOVEMENT OF INDIA (SIMI)")

simi <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(simi)

check <- subset(data, year>= 1971 & group1!="THE ORDER")

order <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(order)

check <- subset(data, year>= 1971 & group1!="TUPAC AMARU REVOLUTIONARY MOVEMENT (MRTA)")

mrta <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(mrta)

check <- subset(data, year>= 1971 & group1!="TUPAMAROS (URUGUAY)")

tupamaros <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(tupamaros)

check <- subset(data, year>= 1971 & group1!="TURKISH PEOPLE'S LIBERATION FRONT (TPLF) (THKP-C)")

thkpc <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                     decapitation_grp1_lag1 +
                     agediff +
                     age1 +
                     age2 +
                     sharedideo2 +
                     sharedsponsor_lag1 +
                     capratioplus_dir +
                     grp1_newalliance_lag1 +
                     grp2_newalliance_lag1+
                     ln_dist +
                     ln_pop1_lag1 +
                     ln_pop2_lag1 +
                     ln_gdppc1_lag1 +
                     ln_gdppc2_lag1 +
                     polity1_lag1 +
                     polity2_lag1 +
                     coldwar+
                     post911+
                     
                     cluster(dyad_id)+
                     strata(numterm1) +
                     frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                   data = check,
                   method = c("efron"),
                   model = TRUE)

summary(thkpc)

groupdrop <- multiplot(aai, aamb, ad, aqap, aqi, aqim, asala, asg, cinchoneros, devsol, dhkpc, dst, eta, farn, gia, hamas, hizballah, huji, hum, ibdac, imu, ira, jem, ji, jmb, jmjb, jum, kmm, let, lifg, lzrf, m19, micg, mira, mlapu, montoneros, mrta, nap, order, ov, pflp, pij, pkk, pkkkg, pra, prc, prima, raf, rb, rhd, simi, sj, sl, spir, thkpc, tupamaros, secret.weapon=T, innerCI = 2, coefficients = c("decapitation_grp1_lag1"), sort = c("magnitude"), names=c("Ansar al-Islam", "Al-Aqsa Martyr's Brigade", "Action Directe" , "AQAP", "AQI", "AQIM", "ASALA", "Abu Sayyaf", "Cinchoneros", "Dev Sol", "DHKP/C", "Dagestani Shar'iah Jamaat", "ETA", "FARN", "GIA", "Hamas", "Hezbollah", "HuJI", "HuM", "Great Eastern Islamic Raiders Front", "IMU", "IRA", "JeM", "Jemaah Islamiyya", "JMB", "JMJB", "JuM", "KMM", "LeT", "LIFG", "LZRF", "M-19", "MICG", "MIRA", "MLAPU", "Montoneros", "MRTA", "NAP", "The Order", "Orange Volunteers", "PFLP", "PIJ", "PKK", "Kongra-Gel", "EPR", "PRC", "Prima Linea", "RAF", "Red Brigades", "Red Hand Defenders", "SIMI", "Salafia Jihadia", "Shining Path", "SPIR", "THKP/C", "Tupamaros"), horizontal = T, color = c("black", "black" , "black" , "black" , "black"), zeroColor ="red", textAngle = 0, title= "", xlab = "Standardized Coefficient", ylab="")
groupdrop


## Figure S.22: Iteratively Dropping Countries

check <- subset(data, year>= 1971 & ccode1!=2)

usa <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(usa)

check <- subset(data, year>= 1971 & ccode1!=70)

mexico <- coxph(formula = Surv(term1_start, term1_end, term1) ~
               decapitation_grp1_lag1 +
               agediff +
               age1 +
               age2 +
               sharedideo2 +
               sharedsponsor_lag1 +
               capratioplus_dir +
               grp1_newalliance_lag1 +
               grp2_newalliance_lag1+
               ln_dist +
               ln_pop1_lag1 +
               ln_pop2_lag1 +
               ln_gdppc1_lag1 +
               ln_gdppc2_lag1 +
               polity1_lag1 +
               polity2_lag1 +
               coldwar+
               post911+
               
               cluster(dyad_id)+
               strata(numterm1) +
               frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
             data = check,
             method = c("efron"),
             model = TRUE)

summary(mexico)

check <- subset(data, year>= 1971 & ccode1!=91)

honduras <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = check,
                method = c("efron"),
                model = TRUE)

summary(honduras)

check <- subset(data, year>= 1971 & ccode1!=92)

elsalvador <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                    decapitation_grp1_lag1 +
                    agediff +
                    age1 +
                    age2 +
                    sharedideo2 +
                    sharedsponsor_lag1 +
                    capratioplus_dir +
                    grp1_newalliance_lag1 +
                    grp2_newalliance_lag1+
                    ln_dist +
                    ln_pop1_lag1 +
                    ln_pop2_lag1 +
                    ln_gdppc1_lag1 +
                    ln_gdppc2_lag1 +
                    polity1_lag1 +
                    polity2_lag1 +
                    coldwar+
                    post911+
                    
                    cluster(dyad_id)+
                    strata(numterm1) +
                    frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                  data = check,
                  method = c("efron"),
                  model = TRUE)

summary(elsalvador)

check <- subset(data, year>= 1971 & ccode1!=100)

colombia <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                      decapitation_grp1_lag1 +
                      agediff +
                      age1 +
                      age2 +
                      sharedideo2 +
                      sharedsponsor_lag1 +
                      capratioplus_dir +
                      grp1_newalliance_lag1 +
                      grp2_newalliance_lag1+
                      ln_dist +
                      ln_pop1_lag1 +
                      ln_pop2_lag1 +
                      ln_gdppc1_lag1 +
                      ln_gdppc2_lag1 +
                      polity1_lag1 +
                      polity2_lag1 +
                      coldwar+
                      post911+
                      
                      cluster(dyad_id)+
                      strata(numterm1) +
                      frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                    data = check,
                    method = c("efron"),
                    model = TRUE)

summary(colombia)

check <- subset(data, year>= 1971 & ccode1!=135)

peru <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                    decapitation_grp1_lag1 +
                    agediff +
                    age1 +
                    age2 +
                    sharedideo2 +
                    sharedsponsor_lag1 +
                    capratioplus_dir +
                    grp1_newalliance_lag1 +
                    grp2_newalliance_lag1+
                    ln_dist +
                    ln_pop1_lag1 +
                    ln_pop2_lag1 +
                    ln_gdppc1_lag1 +
                    ln_gdppc2_lag1 +
                    polity1_lag1 +
                    polity2_lag1 +
                    coldwar+
                    post911+
                    
                    cluster(dyad_id)+
                    strata(numterm1) +
                    frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                  data = check,
                  method = c("efron"),
                  model = TRUE)

summary(peru)

check <- subset(data, year>= 1971 & ccode1!=160)

argentina <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(argentina)

check <- subset(data, year>= 1971 & ccode1!=165)

uruguay <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                     decapitation_grp1_lag1 +
                     agediff +
                     age1 +
                     age2 +
                     sharedideo2 +
                     sharedsponsor_lag1 +
                     capratioplus_dir +
                     grp1_newalliance_lag1 +
                     grp2_newalliance_lag1+
                     ln_dist +
                     ln_pop1_lag1 +
                     ln_pop2_lag1 +
                     ln_gdppc1_lag1 +
                     ln_gdppc2_lag1 +
                     polity1_lag1 +
                     polity2_lag1 +
                     coldwar+
                     post911+
                     
                     cluster(dyad_id)+
                     strata(numterm1) +
                     frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                   data = check,
                   method = c("efron"),
                   model = TRUE)

summary(uruguay)

check <- subset(data, year>= 1971 & ccode1!=200)

uk <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   decapitation_grp1_lag1 +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = check,
                 method = c("efron"),
                 model = TRUE)

summary(uk)

check <- subset(data, year>= 1971 & ccode1!=220)

france <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   decapitation_grp1_lag1 +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = check,
                 method = c("efron"),
                 model = TRUE)

summary(france)

check <- subset(data, year>= 1971 & ccode1!=230)

spain <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = check,
                method = c("efron"),
                model = TRUE)

summary(spain)

check <- subset(data, year>= 1971 & ccode1!=260)

germany <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(germany)

check <- subset(data, year>= 1971 & ccode1!=325)

italy <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   decapitation_grp1_lag1 +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = check,
                 method = c("efron"),
                 model = TRUE)

summary(italy)

check <- subset(data, year>= 1971 & ccode1!=365)

russia <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(russia)

check <- subset(data, year>= 1971 & ccode1!=600)

morocco <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = check,
                method = c("efron"),
                model = TRUE)

summary(morocco)

check <- subset(data, year>= 1971 & ccode1!=615)

algeria <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   decapitation_grp1_lag1 +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = check,
                 method = c("efron"),
                 model = TRUE)

summary(algeria)


check <- subset(data, year>= 1971 & ccode1!=620)

libya <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   decapitation_grp1_lag1 +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = check,
                 method = c("efron"),
                 model = TRUE)

summary(libya)

check <- subset(data, year>= 1971 & ccode1!=640)

turkey <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(turkey)

check <- subset(data, year>= 1971 & ccode1!=645)

iraq <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = check,
                method = c("efron"),
                model = TRUE)

summary(iraq)

check <- subset(data, year>= 1971 & ccode1!=660)

lebanon <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                decapitation_grp1_lag1 +
                agediff +
                age1 +
                age2 +
                sharedideo2 +
                sharedsponsor_lag1 +
                capratioplus_dir +
                grp1_newalliance_lag1 +
                grp2_newalliance_lag1+
                ln_dist +
                ln_pop1_lag1 +
                ln_pop2_lag1 +
                ln_gdppc1_lag1 +
                ln_gdppc2_lag1 +
                polity1_lag1 +
                polity2_lag1 +
                coldwar+
                post911+
                
                cluster(dyad_id)+
                strata(numterm1) +
                frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
              data = check,
              method = c("efron"),
              model = TRUE)

summary(lebanon)

check <- subset(data, year>= 1971 & ccode1!=666)

israel <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                   decapitation_grp1_lag1 +
                   agediff +
                   age1 +
                   age2 +
                   sharedideo2 +
                   sharedsponsor_lag1 +
                   capratioplus_dir +
                   grp1_newalliance_lag1 +
                   grp2_newalliance_lag1+
                   ln_dist +
                   ln_pop1_lag1 +
                   ln_pop2_lag1 +
                   ln_gdppc1_lag1 +
                   ln_gdppc2_lag1 +
                   polity1_lag1 +
                   polity2_lag1 +
                   coldwar+
                   post911+
                   
                   cluster(dyad_id)+
                   strata(numterm1) +
                   frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                 data = check,
                 method = c("efron"),
                 model = TRUE)

summary(israel)

check <- subset(data, year>= 1971 & ccode1!=679)

yemen <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                  decapitation_grp1_lag1 +
                  agediff +
                  age1 +
                  age2 +
                  sharedideo2 +
                  sharedsponsor_lag1 +
                  capratioplus_dir +
                  grp1_newalliance_lag1 +
                  grp2_newalliance_lag1+
                  ln_dist +
                  ln_pop1_lag1 +
                  ln_pop2_lag1 +
                  ln_gdppc1_lag1 +
                  ln_gdppc2_lag1 +
                  polity1_lag1 +
                  polity2_lag1 +
                  coldwar+
                  post911+
                  
                  cluster(dyad_id)+
                  strata(numterm1) +
                  frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                data = check,
                method = c("efron"),
                model = TRUE)

summary(yemen)

check <- subset(data, year>= 1971 & ccode1!=703)

kyrgyzstan <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(kyrgyzstan)

check <- subset(data, year>= 1971 & ccode1!=750)

india <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                      decapitation_grp1_lag1 +
                      agediff +
                      age1 +
                      age2 +
                      sharedideo2 +
                      sharedsponsor_lag1 +
                      capratioplus_dir +
                      grp1_newalliance_lag1 +
                      grp2_newalliance_lag1+
                      ln_dist +
                      ln_pop1_lag1 +
                      ln_pop2_lag1 +
                      ln_gdppc1_lag1 +
                      ln_gdppc2_lag1 +
                      polity1_lag1 +
                      polity2_lag1 +
                      coldwar+
                      post911+
                      
                      cluster(dyad_id)+
                      strata(numterm1) +
                      frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                    data = check,
                    method = c("efron"),
                    model = TRUE)

summary(india)

check <- subset(data, year>= 1971 & ccode1!=770)

pakistan <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                 decapitation_grp1_lag1 +
                 agediff +
                 age1 +
                 age2 +
                 sharedideo2 +
                 sharedsponsor_lag1 +
                 capratioplus_dir +
                 grp1_newalliance_lag1 +
                 grp2_newalliance_lag1+
                 ln_dist +
                 ln_pop1_lag1 +
                 ln_pop2_lag1 +
                 ln_gdppc1_lag1 +
                 ln_gdppc2_lag1 +
                 polity1_lag1 +
                 polity2_lag1 +
                 coldwar+
                 post911+
                 
                 cluster(dyad_id)+
                 strata(numterm1) +
                 frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
               data = check,
               method = c("efron"),
               model = TRUE)

summary(pakistan)

check <- subset(data, year>= 1971 & ccode1!=771)

bangladesh <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                    decapitation_grp1_lag1 +
                    agediff +
                    age1 +
                    age2 +
                    sharedideo2 +
                    sharedsponsor_lag1 +
                    capratioplus_dir +
                    grp1_newalliance_lag1 +
                    grp2_newalliance_lag1+
                    ln_dist +
                    ln_pop1_lag1 +
                    ln_pop2_lag1 +
                    ln_gdppc1_lag1 +
                    ln_gdppc2_lag1 +
                    polity1_lag1 +
                    polity2_lag1 +
                    coldwar+
                    post911+
                    
                    cluster(dyad_id)+
                    strata(numterm1) +
                    frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                  data = check,
                  method = c("efron"),
                  model = TRUE)

summary(bangladesh)

check <- subset(data, year>= 1971 & ccode1!=820)

malaysia <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                      decapitation_grp1_lag1 +
                      agediff +
                      age1 +
                      age2 +
                      sharedideo2 +
                      sharedsponsor_lag1 +
                      capratioplus_dir +
                      grp1_newalliance_lag1 +
                      grp2_newalliance_lag1+
                      ln_dist +
                      ln_pop1_lag1 +
                      ln_pop2_lag1 +
                      ln_gdppc1_lag1 +
                      ln_gdppc2_lag1 +
                      polity1_lag1 +
                      polity2_lag1 +
                      coldwar+
                      post911+
                      
                      cluster(dyad_id)+
                      strata(numterm1) +
                      frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                    data = check,
                    method = c("efron"),
                    model = TRUE)

summary(malaysia)

check <- subset(data, year>= 1971 & ccode1!=840)

philippines <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                    decapitation_grp1_lag1 +
                    agediff +
                    age1 +
                    age2 +
                    sharedideo2 +
                    sharedsponsor_lag1 +
                    capratioplus_dir +
                    grp1_newalliance_lag1 +
                    grp2_newalliance_lag1+
                    ln_dist +
                    ln_pop1_lag1 +
                    ln_pop2_lag1 +
                    ln_gdppc1_lag1 +
                    ln_gdppc2_lag1 +
                    polity1_lag1 +
                    polity2_lag1 +
                    coldwar+
                    post911+
                    
                    cluster(dyad_id)+
                    strata(numterm1) +
                    frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                  data = check,
                  method = c("efron"),
                  model = TRUE)

summary(philippines)

check <- subset(data, year>= 1971 & ccode1!=850)

indonesia <- coxph(formula = Surv(term1_start, term1_end, term1) ~
                       decapitation_grp1_lag1 +
                       agediff +
                       age1 +
                       age2 +
                       sharedideo2 +
                       sharedsponsor_lag1 +
                       capratioplus_dir +
                       grp1_newalliance_lag1 +
                       grp2_newalliance_lag1+
                       ln_dist +
                       ln_pop1_lag1 +
                       ln_pop2_lag1 +
                       ln_gdppc1_lag1 +
                       ln_gdppc2_lag1 +
                       polity1_lag1 +
                       polity2_lag1 +
                       coldwar+
                       post911+
                       
                       cluster(dyad_id)+
                       strata(numterm1) +
                       frailty(dyad_id, distribution = "gamma", method = "em", sparse = FALSE),
                     data = check,
                     method = c("efron"),
                     model = TRUE)

summary(indonesia)

countrydrop <- multiplot(algeria, argentina, bangladesh, colombia, elsalvador, france, germany, honduras, india, indonesia, iraq, israel, italy, kyrgyzstan, lebanon, libya, malaysia, mexico, morocco, pakistan, peru, philippines, russia, spain, turkey, uk, uruguay, usa, yemen, secret.weapon=T, innerCI = 2, coefficients = c("decapitation_grp1_lag1"), sort = c("magnitude"), names=c("Algeria", "Argentina", "Bangladesh" , "Colombia", "El Salvador", "France", "Germany", "Honduras", "India", "Indonesia", "Iraq", "Israel", "Italy", "Kyrgyzstan", "Lebanon", "Libya", "Malaysia", "Mexico", "Morocco", "Pakistan", "Peru", "Philippines", "Russia", "Spain", "Turkey", "United Kingdom", "Uruguay", "United States", "Yemen"), horizontal = T, color = c("black", "black" , "black" , "black" , "black"), zeroColor ="red", textAngle = 0, title= "", xlab = "Standardized Coefficient", ylab="")
countrydrop
